home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / WMS.CAB / AuthenRealmAdmin.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  5.6 KB  |  179 lines

  1. ∩╗┐<%@ Language=VBScript CODEPAGE=65001 %>
  2. <!--#include file="include/wmsLocStrings.inc"-->
  3. <!--#include file="include/wmsServerHash.inc"-->
  4. <!--#include file="include/wmsPlugins.inc"-->
  5. <!--#include file="include/wmsHeader.inc"-->
  6. <!--#include file="include/wmsPageBanner.inc"-->
  7. <!--#include file="include/wmsError.inc"-->
  8. <%
  9. '+-------------------------------------------------------------------------
  10. '
  11. '  Microsoft Windows Media
  12. '  Copyright (C) Microsoft Corporation. All rights reserved.
  13. '
  14. '  File:       AuthenRealmAdmin.asp
  15. '
  16. '  Contents:
  17. '
  18. '--------------------------------------------------------------------------
  19.  
  20. ConnectToPlugin
  21. ConnectToPluginAdmin
  22.  
  23. BeginErrorHandling
  24.  
  25. on error resume next
  26.  
  27. Dim bError
  28. dim strRealm
  29. Dim dwTabIndex    
  30. dwTabIndex = 0
  31.  
  32. strRealm = RemoveSpecifiedChars( SafeUnescape( GetFormStr( "realm" ) ), REGEXP_DANGEROUS_CHARS )
  33.  
  34. Dim strOp
  35. strOp = trim( posting( "submit" ) )
  36. if( 0 < Len( strOp ) ) then
  37.     if ( 0 >= Len( strRealm ) ) then
  38.         err.raise( -1 )
  39.         err.description = RemoveDangerousCharacters( L_SPECIFYREALM_TEXT )
  40.         ErrorDetected( "Realm" )
  41.         Session( "PageReloadedToDisplayError" ) = 1
  42.         bError = TRUE
  43.     else
  44.         if( MAX_LEN_REALM >= Len( CStr( strRealm ) ) ) then
  45.             g_objPluginAdmin.Realm = CStr( strRealm )            
  46.         end if
  47.  
  48.         if( ErrorDetected( "Realm" ) ) then
  49.             Session( "PageReloadedToDisplayError" ) = 1
  50.             bError = TRUE
  51.         else
  52.             if( 0 < Len( g_strEncodedPubPointName ) ) then
  53.                 Response.Redirect( "../pubpoints/pubpoint_props.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & g_strCategory & "&pluginIndex=" & qs("pluginIndex") )
  54.             else
  55.                 Response.Redirect( "../server_props.asp?server=" & g_strQueryStringServer & "&category=" & g_strCategory & "&pluginIndex=" & qs("pluginIndex") )
  56.             end if
  57.         end if
  58.     end if
  59. else
  60.     strRealm = SafeUnescape( CStr( g_objPluginAdmin.Realm ) )
  61. end if
  62.  
  63. WriteHTMLHeader( g_strDecodedServerName ) 
  64. %>
  65. <link rel="stylesheet" type="text/css" href="<%= Session( "cssName" ) %>">
  66. <% WritePluginJSUtils %>
  67. <script language="JavaScript">
  68. <!--
  69. /*@cc_on @*/
  70.  
  71. //////////////////////////////////////////////////////////////////////////////////
  72. function ValidateInput()
  73. {
  74.     <% jsTRY %>
  75.         var bEnableOkay = true;
  76.         var szRealmUnfiltered = new String( document.pluginForm.realm.value );
  77.         var szRealmFiltered = "";
  78.         
  79.         // perform left trim
  80.         szRealmUnfiltered = szRealmUnfiltered.replace( /^\s+/, "" );
  81.  
  82.         // perform right trim
  83.         szRealmUnfiltered = szRealmUnfiltered.replace( /\s+$/, "" );
  84.  
  85.         if( 0 == szRealmUnfiltered.length )
  86.         {
  87.             document.pluginForm.ok.disabled = true;
  88.             return( false );
  89.         }
  90.         
  91.         if( bEnableOkay )
  92.         {
  93.             szRealmFiltered = szRealmUnfiltered.replace( /\`|\'|!|@|#|\$|%|\^|\&|\||{|}|;|:|\<|\>|\?|\"/g, "" );
  94.             if( szRealmUnfiltered != szRealmFiltered )
  95.             {
  96.                 bEnableOkay = false;
  97.             }
  98.         }
  99.         
  100.         if( bEnableOkay )
  101.         {
  102.             document.pluginForm.realm.style.color = "#000000";
  103.             document.pluginForm.ok.disabled = false;
  104.         }
  105.         else
  106.         {
  107.             document.pluginForm.realm.style.color = "#ff0000";
  108.             document.pluginForm.ok.disabled = true;
  109.         }
  110.         
  111.         return( ! document.pluginForm.ok.disabled );
  112.     <% jsCATCH %>
  113.     return( true );
  114. }
  115. -->
  116. </script>
  117. </head>
  118. <body class="pluginBody" oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
  119. <% DrawPluginBanner %>
  120. <table width="90%">
  121. <tr>
  122.     <td valign=top>
  123.     
  124.         <% WriteStdPluginForm %>
  125.  
  126.         <table class="propgroupbox" width="90%" cellspacing="0" cellpadding="3">
  127.         <tr>
  128.             <td>
  129.                 <div class="helptext" align="left"><%= Server.HTMLEncode( L_DIGESTHELP_TEXT ) %></div><br>
  130.             </td>
  131.         </tr>
  132.         <tr>
  133.             <td>
  134.                 <div class="helptext"><% RenderWithErrorCheck Server.HTMLEncode( L_REALMCOLON_TEXT ) , "Realm" %><br></div>
  135.             </td>
  136.         </tr>
  137.         <tr>
  138.             <td>
  139.                 <input 
  140.                     type="text" 
  141.                     name="realm" 
  142.                     maxlength="<%= Server.HTMLEncode( MAX_LEN_REALM ) %>" 
  143.                     value="<%= RemoveSpecifiedChars( strRealm, REGEXP_DANGEROUS_CHARS ) %>" 
  144.                     tabindex="1"
  145.                     onChange="JavaScript:ValidateInput();"
  146.                     onPaste="JavaScript:ValidateInput();"
  147.                     onKeyDown="JavaScript:ValidateInput();"
  148.                     onKeyUp="JavaScript:ValidateInput();"
  149.                     ><br>
  150.             </td>
  151.         </tr>
  152.         </table>
  153.         <br>
  154.     </td>
  155. </tr>
  156. <tr>
  157.     <td valign=bottom>
  158.         <input type="submit" align="baseline" name="ok" value="<%= Server.HTMLEncode( L_OKAYBUTTON_TEXT ) %>" ID="ok" tabIndex=2> 
  159.         <input type="button" align="baseline" name="cancel" onclick="JavaScript:Cancel();" value="<%= Server.HTMLEncode( L_CANCELBUTTONSPACED_TEXT ) %>" tabIndex="3"> 
  160.         <input type="button" align="baseline" name="help" onclick="JavaScript:DoPluginHelp( '<%= H_AUTHENHTTPBASICHELPTOPIC %>' )" value="<%= Server.HTMLEncode( L_HELPBUTTONSPACED_TEXT ) %>" id="help" tabindex=4>
  161.     </td>
  162. </tr>
  163. </table>
  164. </font>
  165. </form>
  166. <%
  167. AlertUserWithPopupErrorDialog
  168. OnErrorGoBack
  169. DrawStdFooter
  170. %>
  171. </body>
  172. </html>
  173. <% 
  174. LatchCurrentPage "plugins/AuthenRealmAdmin.asp", qs
  175. EndErrorHandling "AuthenRealmAdmin.asp" 
  176.  
  177. on error resume next
  178. PluginsASPCleanup
  179. %>